package com.ruoyi.report.service.Impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.report.mapper.ReportCategoryMapper;
import com.ruoyi.report.domain.ReportCategory;
import com.ruoyi.report.service.IReportCategoryService;

/**
 * 报表分类Service业务层处理
 *
 * @author ruoyi
 * @date 2022-03-03
 */
@Service
public class ReportCategoryServiceImpl implements IReportCategoryService
{
    @Autowired
    private ReportCategoryMapper reportCategoryMapper;

    /**
     * 查询报表分类
     *
     * @param id 报表分类主键
     * @return 报表分类
     */
    @Override
    public ReportCategory selectReportCategoryById(Long id)
    {
        return reportCategoryMapper.selectReportCategoryById(id);
    }

    /**
     * 查询报表分类列表
     *
     * @param reportCategory 报表分类
     * @return 报表分类
     */
    @Override
    public List<ReportCategory> selectReportCategoryList(ReportCategory reportCategory)
    {
        return reportCategoryMapper.selectReportCategoryList(reportCategory);
    }

    /**
     * 新增报表分类
     *
     * @param reportCategory 报表分类
     * @return 结果
     */
    @Override
    public int insertReportCategory(ReportCategory reportCategory)
    {
        reportCategory.setCreateTime(DateUtils.getNowDate());
        return reportCategoryMapper.insertReportCategory(reportCategory);
    }

    /**
     * 修改报表分类
     *
     * @param reportCategory 报表分类
     * @return 结果
     */
    @Override
    public int updateReportCategory(ReportCategory reportCategory)
    {
        reportCategory.setUpdateTime(DateUtils.getNowDate());
        return reportCategoryMapper.updateReportCategory(reportCategory);
    }

    /**
     * 批量删除报表分类
     *
     * @param ids 需要删除的报表分类主键
     * @return 结果
     */
    @Override
    public int deleteReportCategoryByIds(Long[] ids)
    {
        return reportCategoryMapper.deleteReportCategoryByIds(ids);
    }

    /**
     * 删除报表分类信息
     *
     * @param id 报表分类主键
     * @return 结果
     */
    @Override
    public int deleteReportCategoryById(Long id)
    {
        return reportCategoryMapper.deleteReportCategoryById(id);
    }
}
